<?php
/**
 * @version		$Id: item.php 26 2010-09-08 15:30:31Z joomlaworks $
 * @package		K2mart
 * @author    JoomlaWorks http://www.joomlaworks.gr
 * @copyright	Copyright (c) 2006 - 2010 JoomlaWorks, a business unit of Nuevvo Webware Ltd. All rights reserved.
 * @license		Commercial - This code cannot be redistributed without permission from Nuevvo Webware Ltd.
 */

defined('_JEXEC') or die('Restricted access');
?>

<!-- K2mart STARTS HERE -->
<div class="itemVmFields">
	<h3><?php echo JText::_('Product Details'); ?></h3>
	<ul>
		<?php if($this->params->get('itemProductName') && !empty($product->name)): ?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::_('Name'); ?>:</span>
			<span class="itemVmFieldsValue"><?php echo $product->name; ?></span>
		</li>
		<?php endif; ?>
		<?php if($this->params->get('itemProductSku') && !empty($product->sku)): ?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::_('SKU'); ?>:</span>
			<span class="itemVmFieldsValue"><?php echo $product->sku; ?></span>
		</li>
		<?php endif; ?>
		<?php if($this->params->get('itemProductUrl') && !empty($product->url)): ?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::_('URL'); ?>:</span>
			<span class="itemVmFieldsValue"><?php echo $product->url; ?></span>
		</li>
		<?php endif; ?>
		<?php if($this->params->get('itemProductVendor') && !empty($product->vendorLink)): ?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::_('Vendor'); ?>:</span>
			<span class="itemVmFieldsValue"><a class="modal" rel="{handler:'iframe',size:{x:900,y:500}}" href="<?php echo $product->vendorLink; ?>"><?php echo $product->vendorName; ?></a></span>
		</li>
		<?php endif; ?>
		<?php if($this->params->get('itemProductManufacturer') && !empty($product->manufacturerLink)): ?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::_('Manufacturer'); ?>:</span>
			<span class="itemVmFieldsValue"><a class="modal" rel="{handler:'iframe',size:{x:900,y:500}}" href="<?php echo $product->manufacturerLink; ?>"><?php echo $product->manufacturerName; ?></a></span>
		</li>
		<?php endif; ?>
		<?php if($this->params->get('itemProductPrice') && $product->price && _SHOW_PRICES): ?>
		<li>
			<span class="itemVmFieldsLabel">
				<?php if($product->unit && VM_PRICE_SHOW_PACKAGING_PRICELABEL): ?>
					<?php echo JText::_('Price per Unit'); ?> (<?php echo $product->unit; ?>):
				<?php else: ?>
					<?php echo JText::_('Price'); ?>:
				<?php endif; ?>
			</span>
			<span class="itemVmFieldsValue itemVmPrice"><?php echo $product->price; ?></span>
			<div class="clr"></div>
		</li>
		<?php endif; ?>
		<?php if($this->params->get('itemProductDimensions')):?>
			<?php if($product->length > 0):?>
			<li>
				<span class="itemVmFieldsLabel"><?php echo JText::_('Length'); ?>:</span>
				<span class="itemVmFieldsValue"><?php echo $product->length; ?> <?php echo $product->dimensionUnit; ?></span>
			</li>
			<?php endif; ?>
			<?php if($product->width > 0):?>
			<li>
				<span class="itemVmFieldsLabel"><?php echo JText::_('Width'); ?>:</span>
				<span class="itemVmFieldsValue"><?php echo $product->width; ?> <?php echo $product->dimensionUnit; ?></span>
			</li>
			<?php endif; ?>
			<?php if($product->height > 0):?>	
			<li>
				<span class="itemVmFieldsLabel"><?php echo JText::_('Height'); ?>:</span>
				<span class="itemVmFieldsValue"><?php echo $product->height; ?> <?php echo $product->dimensionUnit; ?></span>
			</li>
			<?php endif; ?>		
		<?php endif; ?>
		<?php if($this->params->get('itemProductWeight') && $product->weight > 0):?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::_('Weight'); ?>:</span>
			<span class="itemVmFieldsValue"><?php echo $product->weight; ?> <?php echo $product->weightUnit; ?></span>
		</li>		
		<?php endif; ?>
		<?php if($this->params->get('itemProductPackaging') && $product->packaging): ?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::sprintf('Number %ss in packaging', ($product->unit)?$product->unit:JText::_('Price per Unit')); ?>:</span>
			<span class="itemVmFieldsValue"><?php echo $product->packaging; ?></span>
		</li>		
		<?php endif; ?>
		<?php if($this->params->get('itemProductBox') && $product->box): ?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::sprintf('Number %ss in box',($product->unit)?$product->unit:JText::_('Price per Unit')); ?>:</span>
			<span class="itemVmFieldsValue"><?php echo $product->box; ?></span>
		</li>		
		<?php endif; ?>
		<?php if($this->params->get('itemProductType') && $product->type): ?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::_('Type'); ?>:</span>
			<span class="itemVmFieldsValue"><?php echo $product->type; ?></span>
		</li>		
		<?php endif; ?>
		<?php if($this->params->get('itemProductAvailability') && $product->availability): ?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::_('Availability'); ?>:</span>
			<span class="itemVmFieldsValue"><?php echo $product->availability; ?></span>
		</li>		
		<?php endif; ?>
		<?php if($this->params->get('itemProductShipping') && $product->shipping): ?>
		<li>
			<span class="itemVmFieldsLabel"><?php echo JText::_('Usually ships in'); ?>:</span>
			<span class="itemVmFieldsValue"><?php echo $product->shipping; ?></span>
		</li>		
		<?php endif; ?>
	</ul>
  <div class="clr"></div>
	<!-- Button -->
	<?php if($this->params->get('itemProductAddToCart') && !USE_AS_CATALOGUE && $product->price): ?>
	<div class="itemVmFieldsButton">
		<form action="index.php" method="post" name="addtocart" id="<?php echo uniqid('addtocart_') ?>" class="addtocart_form" <?php if(!CHECK_STOCK || $product->stock) { echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>
			<?php if($this->params->get('itemProductAttributes')):?>
				<?php echo $product->attributes; ?>
				<div class="clr"></div>
			<?php else: ?>
				<input type="hidden" value="<?php echo $product->id; ?>" name="product_id">
				<input type="hidden" value="<?php echo $product->id; ?>" name="prod_id[]">
			<?php endif;?>
			<?php if($this->params->get('itemProductQuantity')):?>
				<?php echo $product->quantityBox; ?>
			<?php else: ?>
				<input type="hidden" value="1" name="quantity[]">
			<?php endif;?>
			<input type="submit" class="<?php echo (!CHECK_STOCK || $product->stock)?'addtocart_button':'notify_button' ?>" value="<?php echo (!CHECK_STOCK || $product->stock)?JText::_('Add to Cart'):JText::_('Notify Me!') ?>" title="<?php echo (!CHECK_STOCK || $product->stock)?JText::_('Add to Cart'):JText::_('Notify Me!') ?>" />
			<input type="hidden" name="page" value="shop.cart" />
			<input type="hidden" name="func" value="cartAdd" />
			<input type="hidden" name="option" value="com_virtuemart" />
			<input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>" />
			<input type="hidden" name="set_price[]" value="" />
			<input type="hidden" name="adjust_price[]" value="" />
			<input type="hidden" name="master_product[]" value="" />
		</form>
	</div>
	<?php endif; ?>
</div>
<!-- K2mart ENDS HERE -->
